/*
 * @Author: hcluo
 * @Date: 2020-04-26 15:06:25
 * @LastEditors: hcluo
 * @LastEditTime: 2020-04-26 15:13:43
 * @Description: 政府项目
 */

/**
 * @description 从URL中获取参数
 * @author hcluo
 * @date 2020-04-26
 * @export
 * @param {string} [key=''] 参数名称
 * @returns {string}
 */
export function getParamFromUrl(key = '') {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] === key) { return pair[1]; }
    }
    return null;
}